<?php

namespace App\Http\Controllers;


use App\Http\Controllers;
use GuzzleHttp\Client;
use GuzzleHttp\Pool;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Exception\ClientException;
use App;
use App\Facades\TestTwoFacade;

class indexController extends Controller{

  public function index(){
    TestTwoFacade::add();
    /*dd(agent());
    $myfoo = App::make("help");
    echo $myfoo->add(1,2);die;*/
     \Artisan::call('test:test', [
    ]);
dd();
    $client = new \GuzzleHttp\Client();
    $res = $client->request('GET', 'https://www.github.com/', ['verify' => false]);
    echo $res->getStatusCode();
    // "200"
    echo $res->getHeader('content-type');
    // 'application/json; charset=utf8'
    echo $res->getBody();
    // {"type":"User"...'

    // Send an asynchronous request.
    $request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org');
    $promise = $client->sendAsync($request)->then(function ($response) {
        echo 'I completed! ' . $response->getBody();
    });
    $promise->wait();

  }
}
